module.exports = {
  // 关闭 eslint
  lintOnSave: false,


  // 以下配置没生效 https://blog.csdn.net/interestANd/article/details/118805870
  devServer: {
    open: true,
    port: 9000,
    proxy: {
      '^/api': {
        target: 'http://localhost:8080',
        ws: true,
        changeOrigin: true
      },
      '^/actuator/health': {
        target: 'http://localhost:8080'
      },
      // websocket代理 https://blog.csdn.net/JimBo3693/article/details/100545053
      '/socket': {
        target: 'ws://127.0.0.1:9101/hello/websocket/',//后端目标接口地址
        changeOrigin: true,//是否允许跨域
        pathRewrite: {
          '^/socket': '',//重写,
        },
        ws: true //开启ws, 如果是http代理此处可以不用设置
      }
    }
  }
}
